package com.xinan;

import com.jfinal.aop.ClearInterceptor;
import com.jfinal.aop.ClearLayer;
import com.jfinal.core.BaseController;
import com.jfinal.plugin.activerecord.Record;
import com.xinan.hygl.Hygl;
import com.xinan.xs.HyglXf;

import java.util.List;
@ClearInterceptor(ClearLayer.ALL)
public class XcglController extends BaseController {
	public void index() {
		render("/WEB-INF/views/xcgl/index.html");
	}
    public void sx() {
        String card = getPara("card");
        String where2 = "card='"+card+"' or yhm='"+card+"' or dh='"+card
				+"' or cph='"+card+"' or cph2='"+card+"'";
        String where = " s.card=h.card and (h.card='"+card+"' or h.yhm='"+card+"' or h.dh='"+card
        		+"' or h.cph='"+card+"' or h.cph2='"+card+"') ";
//        List<Record> newlist = HyglXf.dao.findAlls(" card=  '" + card + "'  and yxbz=0");
        List<Record> hyxf = HyglXf.dao.findByHYinfo2(where);
        List<Record> hy = Hygl.dao.findAlls(where2);
//        List<Record> hy = Hygl.dao.findAlls("       card=  '" + card + "'");
//        List<Record> hyxf = HyglXf.dao.findAlls(" card=  '" + card + "'  and yxbz=1");
        setAttr("hylist", hy);
        setAttr("hyxf", hyxf);
        render("/WEB-INF/views/xcgl/list.html");
    }
}
